package lambda;
import lambda.model.Student;
import java.util.function.Consumer;
public class demo7 {
    public static void main(String[] args) {
        Student student=new Student("缓缓");
        Student student1Compare=new Student("君君");
        Student student2Compare=new Student("缓缓");
        //实例方法引用
        Consumer<Student>consumer=student::equals;
        consumer.accept(student1Compare);
        //等价lambda
        Consumer<Student>consumer1=(stuCompare)->
                student.equals(stuCompare);
        consumer1.accept(student2Compare);

    }
}
